package com.takeaway.dao.daolmpl;
import com.takeaway.dao.daointerface.CouponDao;
import com.takeaway.pojo.Coupon;
import com.takeaway.utils.JdbcUtils;

import java.util.ArrayList;

/**
 * @author 后台赖骏
 */
public class CouponDaoImpl implements CouponDao {
    @Override
    public int insert(Coupon coupon) throws Exception{
        return JdbcUtils.insert(coupon);
    }

    @Override
    public int delete(Class<Coupon> clz, String[] checkField, Object... factor) throws Exception{
        return JdbcUtils.delete(clz,checkField,factor);
    }

    @Override
    public int update(Coupon coupon) throws Exception{
        return JdbcUtils.update(coupon);
    }

    @Override
    public Coupon selectSingle(Coupon coupon, String[] checkFields, Object... factor) throws Exception{
        return (Coupon) JdbcUtils.selectSingle(coupon,checkFields,factor);
    }

    @Override
    public ArrayList<Coupon> selectMore(Class<Coupon> clz, int begin, int listNum) throws Exception{
        return (ArrayList<Coupon>) JdbcUtils.selectMore(clz,begin,listNum);
    }

    @Override
    public ArrayList<Coupon> selectMore(Class<Coupon> clz, String[] checkField, Object... factor) throws Exception{
        return (ArrayList<Coupon>) JdbcUtils.selectMore(clz,checkField,factor);
    }
}
